fid = fopen("data.nodes", "r+");

a = fscanf(fid, "%lf");

x = a(1:2:end);
y = a(2:2:end);

T = delaunay(x,y);

fid_result = fopen("data.edges", "w+");
for n=1:size(T,1)
	fprintf(fid_result, " %d %d %d \n", T(n,1), T(n,2), T(n,3));
end

fclose(fid);
fclose(fid_result);